home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / formats / bwdev201 / bluewave.inc < prev    next >
Text File  |  1994-01-18  |  50KB  |  877 lines

  1. (*****************************************************************************)
  2. (*                                                                           *)
  3. (*           The Blue Wave Offline Mail System Packet Structures             *)
  4. (*     Copyright 1990-1994 by George Hatchew and Cutting Edge Computing      *)
  5. (*                 All rights reserved - FidoNet 1:2240/176                  *)
  6. (*                                                                           *)
  7. (*                     Last Updated - January 18, 1994                       *)
  8. (*                                                                           *)
  9. (*        ---------------------------------------------------------          *)
  10. (*            DISTRIBUTION OF THIS FILE IS LIMITED BY THE TERMS              *)
  11. (*           SPECIFIED IN THE BLUE WAVE STRUCTURE DOCUMENTATION!             *)
  12. (*        ---------------------------------------------------------          *)
  13. (*                                                                           *)
  14. (*   NOTE:  Refer to BLUEWAVE.H and the Blue Wave structure documentation    *)
  15. (*          for additional comments and information.                         *)
  16. (*                                                                           *)
  17. (*****************************************************************************)
  18.  
  19. const
  20.   PACKET_LEVEL=2;                 { Mail packet revision level  }
  21.   ORIGINAL_INF_HEADER_LEN=1230;   { Original *.INF header len   }
  22.   ORIGINAL_INF_AREA_LEN=80;       { Original *.INF area rec len }
  23.   ORIGINAL_MIX_STRUCT_LEN=14;     { Original *.MIX record len   }
  24.   ORIGINAL_FTI_STRUCT_LEN=186;    { Original *.FTI record len   }
  25.  
  26. type
  27.  
  28.  
  29. (*****************************************************************************)
  30. (* >>>>>>>>>>>>>>>>>>>>>  DOOR DATA FILE STRUCTURES  <<<<<<<<<<<<<<<<<<<<<<< *)
  31. (*****************************************************************************)
  32.  
  33.  
  34. (*
  35. **  Name of file:   *.INF
  36. **
  37. **  Description:    The *.INF file is the source of information for just about
  38. **                  everything from the host BBS, as well as definitions for
  39. **                  all of the message areas that are available to the user
  40. **                  and their status (Local, EchoMail, NetMail, Read Only,
  41. **                  etc.).
  42. **
  43. **  File format:    INF_HEADER          { only included one time!        }
  44. **                  INF_AREA_INFO       { repeated for as many msg bases }
  45. **                  INF_AREA_INFO       { as are available to the user   }
  46. **                  ...
  47. *)
  48.  
  49. inf_uflags =
  50. (
  51.   INF_HOTKEYS,          { User uses "hotkeys" in door prompts   }
  52.   INF_XPERT,            { Short menus displayed in door         }
  53.   INF_RES1,             { RESERVED -- DO NOT USE!               }
  54.   INF_GRAPHICS,         { Enable ANSI control sequences in door }
  55.   INF_NOT_MY_MAIL,      { Do not bundle mail from user          }
  56.   INF_UFLAG_RES1,       { RESERVED FOR FUTURE USE               }
  57.   INF_UFLAG_RES2,       { RESERVED FOR FUTURE USE               }
  58.   INF_UFLAG_RES3,       { RESERVED FOR FUTURE USE               }
  59.   INF_UFLAG_RES4,       { RESERVED FOR FUTURE USE               }
  60.   INF_UFLAG_RES5,       { RESERVED FOR FUTURE USE               }
  61.   INF_UFLAG_RES6,       { RESERVED FOR FUTURE USE               }
  62.   INF_UFLAG_RES7,       { RESERVED FOR FUTURE USE               }
  63.   INF_UFLAG_RES8,       { RESERVED FOR FUTURE USE               }
  64.   INF_UFLAG_RES9,       { RESERVED FOR FUTURE USE               }
  65.   INF_UFLAG_RES10,      { RESERVED FOR FUTURE USE               }
  66.   INF_UFLAG_RES11       { RESERVED FOR FUTURE USE               }
  67. );
  68.  
  69. inf_netmail_flags =
  70. (
  71.   INF_CAN_CRASH,        { Allow Crash status          }
  72.   INF_CAN_ATTACH,       { Allow File Attach messages  }
  73.   INF_CAN_KSENT,        { Allow Kill/Sent status      }
  74.   INF_CAN_HOLD,         { Allow Hold status           }
  75.   INF_CAN_IMM,          { Allow Immediate status      }
  76.   INF_CAN_FREQ,         { Allow File Request messages }
  77.   INF_CAN_DIRECT,       { Allow Direct status         }
  78.   INF_NETMAIL_RES1,     { RESERVED FOR FUTURE USE     }
  79.   INF_NETMAIL_RES2,     { RESERVED FOR FUTURE USE     }
  80.   INF_NETMAIL_RES3,     { RESERVED FOR FUTURE USE     }
  81.   INF_NETMAIL_RES4,     { RESERVED FOR FUTURE USE     }
  82.   INF_NETMAIL_RES5,     { RESERVED FOR FUTURE USE     }
  83.   INF_NETMAIL_RES6,     { RESERVED FOR FUTURE USE     }
  84.   INF_NETMAIL_RES7,     { RESERVED FOR FUTURE USE     }
  85.   INF_NETMAIL_RES8,     { RESERVED FOR FUTURE USE     }
  86.   INF_NETMAIL_RES9      { RESERVED FOR FUTURE USE     }
  87. );
  88.  
  89. INF_HEADER =
  90. record
  91.   ver:byte;                       { Packet version type (currently 2)        }
  92.   readerfiles:array[1..5] of      { Files to be displayed by reader          }
  93.               array[1..13] of byte;
  94.   regnum:array[1..9] of byte;     { User's registration number               }
  95.   mashtype:byte;                  { Currently unused (door fills with 0)     }
  96.                                   {   Reserved for Blue Wave reader to store }
  97.                                   {   the compression type the packet uses.  }
  98.   loginname:array[1..43] of byte; { Name user types at BBS login             }
  99.   aliasname:array[1..43] of byte; { User's "other" name                      }
  100.   password:array[1..21] of byte;  { Password                                 }
  101.                                   {   All bytes should be the actually ASCII }
  102.                                   {   value plus 10.  Lame security, yes,    }
  103.                                   {   but it does prevent "TYPE *.INF" from  }
  104.                                   {   showing the password.                  }
  105.   passtype:byte;                  { Password type                            }
  106.                                   {   0=none 1=door 2=reader 3=both          }
  107.   zone:word;                      { Main network address of host BBS         }
  108.   net:word;                       {   (zone:net/node.point)                  }
  109.   node:word;
  110.   point:word;
  111.   sysop:array[1..41] of byte;     { Name of SysOp of host BBS                }
  112.   obsolete1:array[1..2] of byte;  { OBSOLETE -- DO NOT USE!                  }
  113.   systemname:array[1..65]         { Name of host BBS                         }
  114.              of byte;
  115.   maxfreqs:byte;                  { Max number of file requests allowed      }
  116.   obsolete2:array[1..6] of byte;  { OBSOLETE -- DO NOT USE!                  }
  117.   uflags:set of inf_uflags;       { Bit-mapped door options/toggles          }
  118.   keywords:array[1..10] of        { User's entire set of door keywords       }
  119.            array[1..21] of byte;
  120.   filters:array[1..10] of         { User's entire set of door filters        }
  121.           array[1..21] of byte;
  122.   macros:array[1..3] of           { User's door bundling command macros      }
  123.          array[1..80] of byte;
  124.   netmail_flags:set of            { Bit-mapped NetMail options               }
  125.                 inf_netmail_flags;
  126.   credits:word;                   { NetMail credits                          }
  127.   debits:word;                    { NetMail debits                           }
  128.   can_forward:byte;               { 0=Message forwarding not allowed         }
  129.   inf_header_len:word;            { Size of INF_HEADER structure             }
  130.   inf_areainfo_len:word;          { Size of INF_AREA_INFO structure          }
  131.   mix_structlen:word;             { Size of MIX_REC structure                }
  132.   fti_structlen:word;             { Size of FTI_REC structure                }
  133.   uses_upl_file:byte;             { If this field is not zero, the door that }
  134.                                   {   created this packet can receive reply  }
  135.                                   {   packets in the new *.UPL file format.  }
  136.                                   {   Otherwise, the old *.UPI and *.NET     }
  137.                                   {   files must be used.                    }
  138.   from_to_len:byte;               { The maximum length of the FROM: and TO:  }
  139.                                   {   fields that the host BBS can support.  }
  140.                                   {   If this value is 0 or is greater than  }
  141.                                   {   35, then 35 must be used (the upload   }
  142.                                   {   file formats only allow for a maximum  }
  143.                                   {   of 35 characters).                     }
  144.   subject_len:byte;               { The maximum length of the SUBJECT: field }
  145.                                   {   that the host BBS can support.  If     }
  146.                                   {   this value is 0 or is greater than 71, }
  147.                                   {   then 71 must be used (the upload file  }
  148.                                   {   formats only allow for a maximum of 71 }
  149.                                   {   characters).                           }
  150.   packet_id:array[1..9] of byte;  { Original root name of the mail packet,   }
  151.                                   {   as specified by the mail door.  All    }
  152.                                   {   files in the packet that are created   }
  153.                                   {   by the mail door will use this root    }
  154.                                   {   name, as will the reader when creating }
  155.                                   {   the upload files.  Thus, even if the   }
  156.                                   {   packets themselves are renamed to      }
  157.                                   {   something completely different, the    }
  158.                                   {   mail doors and readers will still be   }
  159.                                   {   able to work with the proper files.    }
  160.   reserved:array[1..234] of byte; { RESERVED FOR FUTURE USE                  }
  161.                                   {   This field MUST be filled with ASCII   }
  162.                                   {   NUL (0x00) characters in order for     }
  163.                                   {   future additional features to work     }
  164.                                   {   properly!                              }
  165. end;
  166.  
  167. inf_area_flags =
  168. (
  169.   INF_SCANNING,         { On=User is active for area               }
  170.   INF_ALIAS_NAME,       { On=Alias name, Off=Login name            }
  171.                         {   If ON, use INF_HEADER.ALIASNAME when   }
  172.                         {   addressing new mail or replies for the }
  173.                         {   message area.  If OFF, the reader uses }
  174.                         {   the INF_HEADER.LOGINNAME for this      }
  175.                         {   purpose.                               }
  176.   INF_ANY_NAME,         { On=Allow any name to be entered          }
  177.                         {   If ON, any name can be entered in the  }
  178.                         {   From: field when addressing new mail   }
  179.                         {   or replies for the message area.  If   }
  180.                         {   OFF, the normal rules apply.           }
  181.   INF_ECHO,             { On=Network area, Off=Local area          }
  182.                         {   The style of network mail depends on   }
  183.                         {   the setting of the NETWORK_TYPE field. }
  184.   INF_NETMAIL,          { On=Private network mail                  }
  185.                         {   The style of private mail depends on   }
  186.                         {   the setting of the NETWORK_TYPE field. }
  187.                         {   (If INF_ECHO is off, this field is     }
  188.                         {   ignored.)                              }
  189.   INF_POST,             { On=User can post, Off=User CANNOT post   }
  190.   INF_NO_PRIVATE,       { On=Private messages are NOT allowed      }
  191.   INF_NO_PUBLIC,        { On=Public messages are NOT allowed       }
  192.   INF_NO_TAGLINE,       { On=Taglines are not allowed              }
  193.                         {   (Not yet implemented in Blue Wave.)    }
  194.   INF_NO_HIGHBIT,       { On=ASCII 1-127 only, Off=ASCII 1-255     }
  195.                         {   If ON, only ASCII values 1 to 127 are  }
  196.                         {   allowed in messages.  If OFF, all      }
  197.                         {   values from 1 to 255 are allowed.  Due }
  198.                         {   to the fact that ASCII value 0 is used }
  199.                         {   in C as a string terminator, the value }
  200.                         {   0 should not be allowed in messages at }
  201.                         {   all.                                   }
  202.   INF_NOECHO,           { On=User can prevent messages from being  }
  203.                         {   sent through the network               }
  204.   INF_HASFILE           { On=User can attach files to messages     }
  205. );
  206.  
  207. inf_network_types =
  208. (
  209.   INF_NET_FIDONET,      { 0=Set up for FidoNet-style network mail  }
  210.   INF_NET_QWKNET,       { 1=Set up for QWK packet network mail     }
  211.   INF_NET_INTERNET      { 2=Set up for Internet/Usenet mail        }
  212. );
  213.  
  214. INF_AREA_INFO =
  215. record
  216.   areanum:array[1..6] of byte;    { Area number this record corresponds to  }
  217.   echotag:array[1..21] of byte;   { Area tag name (*.BRD name for Telegard) }
  218.   title:array[1..50] of byte;     { Area description/title                  }
  219.   area_flags:set of               { Bit-mapped area options                 }
  220.              inf_area_flags;
  221.   network_type:inf_network_types; { Network mail type (if INF_ECHO set)     }
  222.                                   {   If INF_ECHO is OFF, then this field   }
  223.                                   {   can be ignored.                       }
  224. end;
  225.  
  226. (*---------------------------------------------------------------------------*)
  227.  
  228. (*
  229. **  Name of file:   *.MIX
  230. **
  231. **  Description:    The *.MIX file is a very small file, with one record for
  232. **                  every message area that was scanned.  It contains the
  233. **                  information to get into the *.FTI file.
  234. **
  235. **  File format:    MIX_REC     { repeated for each message area scanned }
  236. **                  MIX_REC
  237. **                  ...
  238. *)
  239.  
  240. MIX_REC =
  241. record
  242.   areanum:array[1..6]       { Area number this record corresponds to         }
  243.           of byte;          {   This is the ASCII representation of the      }
  244.                             {   actual area number shown on the host BBS.    }
  245.   totmsgs:word;             { Total number of messages for this area         }
  246.   numpers:word;             { Total number of personal messages in this area }
  247.   msghptr:longint;          { Pointer to first message header in *.FTI file  }
  248. end;
  249.  
  250. (*---------------------------------------------------------------------------*)
  251.  
  252. (*
  253. **  Name of file:   *.FTI
  254. **
  255. **  Description:    The *.FTI file contains the information for each message
  256. **                  in the packet.  Each record includes all of the
  257. **                  information about the message, including the pointer to
  258. **                  the actual message text in the *.DAT file.
  259. **
  260. **                  NOTE:   Messages in the *.FTI file will ALWAYS be in area
  261. **                          number order.  That is to say, if the MIX_REC
  262. **                          indicates there are 100 messages for this area,
  263. **                          all 100 messages will follow in sequential order.
  264. **
  265. **  File format:    FTI_REC     { repeated for as many messages }
  266. **                  FTI_REC     { as obtained from the host BBS }
  267. **                  ...
  268. *)
  269.  
  270. fti_flags =
  271. (
  272.   FTI_MSGPRIVATE,       { Private = For addressee ONLY         }
  273.   FTI_MSGCRASH,         { Crash = High priority mail           }
  274.   FTI_MSGREAD,          { Read = Message read by addressee     }
  275.   FTI_MSGSENT,          { Sent = Message sent                  }
  276.   FTI_MSGFILE,          { File Attach = Send file(s)           }
  277.   FTI_MSGFWD,           { Forward = Message to/from others     }
  278.   FTI_MSGORPHAN,        { Orphan = Message destination unknown }
  279.   FTI_MSGKILL,          { Kill/Sent = Delete after sending     }
  280.   FTI_MSGLOCAL,         { Local = Message originated here      }
  281.   FTI_MSGHOLD,          { Hold = Hold for pickup, don't send   }
  282.   FTI_MSGIMMEDIATE,     { Immediate = Send message NOW         }
  283.   FTI_MSGFRQ,           { File Request = Request file(s)       }
  284.   FTI_MSGDIRECT,        { Direct = Send direct, no routing     }
  285.   FTI_MSGUNUSED1,       {                                      }
  286.   FTI_MSGUNUSED2,       {                                      }
  287.   FTI_MSGURQ            { Update Request = Req updated file(s) }
  288. );
  289.  
  290. FTI_REC =
  291. record
  292.   mfrom:array[1..36] of byte; { Person message is from                       }
  293.   mto:array[1..36] of byte;   { Person message is to                         }
  294.   subject:array[1..72]        { Subject/title of message                     }
  295.           of byte;
  296.   date:array[1..20] of byte;  { Origin date of message                       }
  297.                               {   Depending on the host BBS's date storage   }
  298.                               {   format, the EXACT format of this field     }
  299.                               {   will change.  Some will take all 19 bytes, }
  300.                               {   others may take only 10.                   }
  301.   msgnum:word;                { Number of THIS message on BBS                }
  302.   replyto:word;               { "This is a reply to #xx"                     }
  303.                               {   Not used for every message.  When non-     }
  304.                               {   zero, there is a previous message in       }
  305.                               {   the thread.                                }
  306.   replyat:word;               { "There is a reply at #xx"                    }
  307.                               {   Not used for every message.  When non-     }
  308.                               {   zero, there is a reply to this message.    }
  309.   msgptr:longint;             { Offset to start of message in *.DAT file     }
  310.                               {   Seek to this exact offset in the *.DAT     }
  311.                               {   file, then read "msglength" bytes from     }
  312.                               {   the file to load the entire message text.  }
  313.   msglength:longint;          { Length of message text (in bytes)            }
  314.   flags:set of fti_flags;     { Bit-mapped message status flags              }
  315.   orig_zone:word;             { Origin address of message                    }
  316.                               {   These three fields will most likely be 0,  }
  317.                               {   unless the current message belongs to a    }
  318.                               {   NetMail message base.                      }
  319.   orig_net:word;
  320.   orig_node:word;
  321. end;
  322.  
  323. (*---------------------------------------------------------------------------*)
  324.  
  325. (*
  326. **  Name of file:   *.DAT
  327. **
  328. **  Description:    The *.DAT file is an unstructured file which contains the
  329. **                  text of every message obtained from the host BBS.
  330. **                  Valid messages begin with an ASCII space (0x20) character
  331. **                  (which is NOT to be considered part of the message!)
  332. **                  followed by zero or more bytes which constitute the
  333. **                  message text.  The pointer to the text for each message is
  334. **                  stored in FTI_REC.MSGPTR, and the length of the text for
  335. **                  each message is stored in FTI_REC.MSGLENGTH.
  336. **
  337. **  File format:    Unstructured
  338. *)
  339.  
  340.  
  341. (*****************************************************************************)
  342. (* >>>>>>>>>>>>>>>>>  MISCELLANEOUS DATA FILE STRUCTURES  <<<<<<<<<<<<<<<<<< *)
  343. (*****************************************************************************)
  344.  
  345.  
  346. (*
  347. **  Name of file:   *.MSG
  348. **
  349. **  Description:    The Fido *.MSG message (named for the BBS program on which
  350. **                  it originated) has become a de-facto standard among BBS
  351. **                  implementations, due to the sheer number of utilities
  352. **                  available that operate with *.MSG messages.  It is as
  353. **                  close to a universal message format as one can get in
  354. **                  FidoNet (and FidoNet-style networks), and is the reason
  355. **                  why it is used here (well, the *.MSG header, anyway).
  356. **
  357. **                  NOTE:   Most of the fields in the FTI_REC structure (shown
  358. **                          above) correspond to similar fields in MSG_REC.
  359. **                          This was done deliberately, in order to make
  360. **                          *.FTI file processing a little more intuitive for
  361. **                          programmers.  Also note that MSG_REC is only used
  362. **                          by the NET_REC structure, which will soon become
  363. **                          obsolete (replaced by UPL_REC).
  364. **
  365. **  File format:    MSG_REC         { only included one time!                }
  366. **                  message text    { text can be terminated by an ASCII NUL }
  367. **                                  { character (0x00), or by an ASCII CR,   }
  368. **                                  { LF, NUL (0x0D 0x0A 0x00) sequence      }
  369. *)
  370.  
  371. msg_attr =
  372. (
  373.   MSG_PRIVATE,          { Private                }
  374.   MSG_CRASH,            { Crash mail             }
  375.   MSG_RECEIVED,         { Received               }
  376.   MSG_SENT,             { Sent                   }
  377.   MSG_FATTACH,          { File attached          }
  378.   MSG_INTRANSIT,        { In-transit             }
  379.   MSG_ORPHAN,           { Orphaned               }
  380.   MSG_KILL,             { Kill after sending     }
  381.   MSG_LOCAL,            { Local message          }
  382.   MSG_HOLD,             { Hold for pickup        }
  383.   MSG_RESERVED,         { RESERVED               }
  384.   MSG_FREQ,             { File request           }
  385.   MSG_RREQ,             { Return receipt request }
  386.   MSG_RECEIPT,          { Return receipt message }
  387.   MSG_AREQ,             { Audit request          }
  388.   MSG_FUREQ             { File update request    }
  389. );
  390.  
  391. MSG_REC =
  392. record
  393.   mfrom:array[1..36]      { Person message is from                           }
  394.        of byte;
  395.   mto:array[1..36]        { Person message is to                             }
  396.      of byte;
  397.   subj:array[1..72]       { Subject/title of message                         }
  398.        of byte;
  399.   date:array[1..20]       { Creation date/time                               }
  400.        of byte;           {   This date/time is usually in either of the     }
  401.                           {   Fido-sanctioned formats "DD MMM YY  HH:MM:SS"  }
  402.                           {   or "WWW DD MMM YY HH:MM", but due to the       }
  403.                           {   chaotic nature of FidoNet-compatible software, }
  404.                           {   this CANNOT be relied upon!                    }
  405.   times:word;             { Number of times read (fairly obsolete)           }
  406.   dest:word;              { Destination node (of net/node)                   }
  407.   orig:word;              { Origin node (of net/node)                        }
  408.   cost:word;              { Cost of sending message (usually in US cents)    }
  409.   orig_net:word;          { Origin net (of net/node)                         }
  410.   destnet:word;           { Destination net (of net/node)                    }
  411.   unused1:longint;        { Undefined                                        }
  412.   unused2:longint;        {   Some software (Opus and Maximus, for example)  }
  413.                           {   uses these fields to store the sent/received   }
  414.                           {   date/time as bit-packed fields, using the same }
  415.                           {   format used in MS-DOS directory entries.       }
  416.   reply:word;             { Message # that this message replies to           }
  417.   attr:set of msg_attr;   { Message attributes and behavior flags            }
  418.   up:word;                { Message # that replies to this message           }
  419. end;
  420.  
  421. (*---------------------------------------------------------------------------*)
  422.  
  423. (*
  424. **  Name of file:   *.XTI
  425. **
  426. **  Description:    The *.XTI file contains extended information for each
  427. **                  message in the packet.  The number of records in the *.XTI
  428. **                  file will always equal the number of messages in the
  429. **                  packet, with each record corresponding to a record in the
  430. **                  *.FTI file (i.e. record #1 in the *.XTI file corresponds
  431. **                  to record #1 in the *.FTI file, and so on).
  432. **
  433. **                  NOTE:   This file is currently created ONLY by the Blue
  434. **                          Wave reader, and is not a part of the official
  435. **                          Blue Wave packet specification; it is merely
  436. **                          documented here for third party programmers to use
  437. **                          if they so desire.  How other readers store which
  438. **                          messages have been read/replied-to/marked is left
  439. **                          as an option to be implemented by the individual
  440. **                          reader authors.  You may use this method if you so
  441. **                          desire; however, PLEASE do not name any external
  442. **                          files not conforming to this specification as
  443. **                          <packet-ID>.XTI, due to the fact that the Blue
  444. **                          Wave reader will expect the file to be in the
  445. **                          format described.  If it's not in the expected
  446. **                          format, things will get interesting. :-)
  447. **
  448. **  File format:    XTI_REC     { repeated for as many messages }
  449. **                  XTI_REC     { as obtained from the host BBS }
  450. **                  ...
  451. *)
  452.  
  453. xti_flags =
  454. (
  455.   XTI_HAS_READ,         { Message has been read       }
  456.   XTI_HAS_REPLIED,      { Message has been replied to }
  457.   XTI_IS_PERSONAL       { Message is personal         }
  458. );
  459.  
  460. xti_marks =
  461. (
  462.   XTI_MARK_SAVE,        { Message marked for saving   }
  463.   XTI_MARK_REPLY,       { Message marked for replying }
  464.   XTI_MARK_PRINT,       { Message marked for printing }
  465.   XTI_MARK_DELETE       { Message marked for deletion }
  466. );
  467.  
  468. XTI_REC =
  469. record
  470.   flags:set of xti_flags;     { Bit-mapped message flags   }
  471.   marks:set of xti_marks;     { Bit-mapped message markers }
  472. end;
  473.  
  474.  
  475. (*****************************************************************************)
  476. (* >>>>>>>>>>>>>>>>>>>>  READER DATA FILE STRUCTURES  <<<<<<<<<<<<<<<<<<<<<< *)
  477. (*****************************************************************************)
  478.  
  479.  
  480. (*
  481. **  Name of file:   *.NET
  482. **
  483. **  Description:    The *.NET file is created ONLY when there is NetMail to be
  484. **                  sent.  It contains the FULL header of the Fido-style *.MSG
  485. **                  structure plus the fields defined below (which aren't part
  486. **                  of the standard *.MSG structure yet required by the door).
  487. **
  488. **  File format:    NET_REC     { repeated for as many NetMail    }
  489. **                  NET_REC     { messages as exist in the packet }
  490. **                  ...
  491. *)
  492.  
  493. NET_REC =
  494. record
  495.   msg:MSG_REC;                  { The Fido-style *.MSG header                }
  496.   fname:array[1..13] of byte;   { Filename the message text is in            }
  497.   echotag:array[1..21] of byte; { NetMail area tag (*.BRD name for Telegard) }
  498.   zone:word;                    { Destination zone (of zone:net/node.point)  }
  499.   point:word;                   { Destination point (of zone:net/node.point) }
  500.   unix_date:longint;            { Date/time of message                       }
  501.                                 {   This Unix-style date/time value (number  }
  502.                                 {   of seconds since 01/01/70) is converted  }
  503.                                 {   to the date/time storage method used by  }
  504.                                 {   the host BBS.                            }
  505. end;
  506.  
  507. (*---------------------------------------------------------------------------*)
  508.  
  509. (*
  510. **  Name of file:   *.UPI
  511. **
  512. **  Description:    The *.UPI file contains the information for each message
  513. **                  in the reply packet, as well as information on the reader
  514. **                  version and registration numbers.  Each record includes
  515. **                  all of the information about the message.
  516. **
  517. **  File format:    UPI_HEADER      { only included one time!        }
  518. **                  UPI_REC         { repeated for as many msg bases }
  519. **                  UPI_REC         { as are available to the user   }
  520. **                  ...
  521. *)
  522.  
  523. UPI_HEADER =
  524. record
  525.   regnum:array[1..9] of byte; { Reader registration number                   }
  526.   vernum:array[1..13]         { Reader version number                        }
  527.          of byte;             {   All bytes should be the actually ASCII     }
  528.                               {   value plus 10.  Lame security, yes, but it }
  529.                               {   does prevent "TYPE *.UPI" from showing the }
  530.                               {   version number.                            }
  531.   future:array[1..33]         { RESERVED FOR FUTURE USE                      }
  532.          of byte;
  533. end;
  534.  
  535. upi_flags =
  536. (
  537.   UPI_RES1,             { RESERVED FOR FUTURE USE                   }
  538.   UPI_RES2,             { RESERVED FOR FUTURE USE                   }
  539.   UPI_RES3,             { RESERVED FOR FUTURE USE                   }
  540.   UPI_RES4,             { RESERVED FOR FUTURE USE                   }
  541.   UPI_RES5,             { RESERVED FOR FUTURE USE                   }
  542.   UPI_RES6,             { RESERVED FOR FUTURE USE                   }
  543.   UPI_PRIVATE,          { Message is PRIVATE                        }
  544.   UPI_NO_ECHO           { Message is NOT to be echoed               }
  545.                         {   This feature is not yet implemented in  }
  546.                         {   the Blue Wave reader or doors, as none  }
  547.                         {   of the currently supported BBS software }
  548.                         {   has support for this feature.           }
  549. );
  550.  
  551. UPI_REC =
  552. record
  553.   mfrom:array[1..36] of byte;   { Person message is from                     }
  554.   mto:array[1..36] of byte;     { Person message is to                       }
  555.   subj:array[1..72] of byte;    { Subject/title of message                   }
  556.   unix_date:longint;            { Date/time of message                       }
  557.                                 {   This Unix-style date/time value (number  }
  558.                                 {   of seconds since 01/01/70) is converted  }
  559.                                 {   to the date/time storage method used by  }
  560.                                 {   the host BBS.                            }
  561.   fname:array[1..13] of byte;   { Filename the message text is in            }
  562.   echotag:array[1..21] of byte; { Area tag name (*.BRD name for Telegard)    }
  563.   flags:set of upi_flags;       { Bit-mapped flags                           }
  564.   reedit:byte;                  { INTERNAL USE ONLY!                         }
  565.                                 {   This flag is used internally by the Blue }
  566.                                 {   Wave reader.  Doors should ignore this   }
  567.                                 {   field during reply packet processing.    }
  568. end;
  569.  
  570. (*---------------------------------------------------------------------------*)
  571.  
  572. (*
  573. **  Name of file:   *.UPL
  574. **
  575. **  Description:    The *.UPL file contains the information for each message
  576. **                  in the reply packet, as well as information on the reader
  577. **                  version and registration numbers.  Each record includes
  578. **                  all of the information about the message.
  579. **
  580. **                  NOTE:   The *.UPL file is only generated by the Blue Wave
  581. **                          reader version 2.11 and later.  *.UPL is intended
  582. **                          to eventually replace the *.NET and *.UPI files,
  583. **                          but door authors should code for the possibility
  584. **                          of both instances (however, *.UPL should be used
  585. **                          if present).
  586. **
  587. **  File format:    UPL_HEADER      { only included one time!       }
  588. **                  UPL_REC         { repeated for as many messages }
  589. **                  UPL_REC         { as are included in the packet }
  590. **                  ...
  591. *)
  592.  
  593. UPL_HEADER =
  594. record
  595.   regnum:array[1..10]         { Reader registration number (if desired)      }
  596.          of byte;
  597.   vernum:array[1..20]         { Reader version number as a string.           }
  598.          of byte;             {   All bytes should be the actually ASCII     }
  599.                               {   value plus 10.  Lame security, yes, but it }
  600.                               {   does prevent "TYPE *.UPL" from showing the }
  601.                               {   version number.                            }
  602.                               {   Examples:  "2.10a Beta"                    }
  603.                               {              "2.11"                          }
  604.   reader_major:byte;          { Major version of the reader (number to the   }
  605.                               {   left of the decimal point)                 }
  606.   reader_minor:byte;          { Minor version of the reader (number to the   }
  607.                               {   right of the decimal point)                }
  608.   reader_name:array[1..80]    { String containing name of the reader, such   }
  609.               of byte;        {   as "The Blue Wave Offline Mail Reader".    }
  610.                               {   This is provided for door programmers that }
  611.                               {   wish to display the name of the reader     }
  612.                               {   that created the reply packet.  (Filling   }
  613.                               {   it is mandatory but using it is optional.) }
  614.   upl_header_len:word;        { Size of UPL_HEADER structure                 }
  615.   upl_rec_len:word;           { Size of UPL_REC structure                    }
  616.                               {   NOTE:  Refer to the INF_HEADER section for }
  617.                               {          more information on using the size  }
  618.                               {          fields.                             }
  619.   loginname:array[1..44]      { Name found in INF_HEADER.LOGINNAME.  This is }
  620.             of byte;          {   provided for door authors as a security    }
  621.                               {   measure to implement as they wish.         }
  622.   aliasname:array[1..44]      { Name found in INF_HEADER.ALIASNAME           }
  623.             of byte;
  624.   reader_tear:array[1..16]    { String containing abbreviated name of the    }
  625.               of byte;        {   reader, such as "Blue Wave", "Q-Blue",     }
  626.                               {   "Wave Rider", etc.  This is provided for   }
  627.                               {   doors programmers that wish to add to the  }
  628.                               {   tear line the name of the reader that      }
  629.                               {   created the reply packet.  (Filling it is  }
  630.                               {   mandatory but using it is optional.)       }
  631.   pad:array[1..36] of byte;   { RESERVED FOR FUTURE USE, and to pad struct   }
  632.                               {   out to a 'nice' 256 bytes                  }
  633. end;
  634.  
  635. upl_msg_attr =
  636. (
  637.   UPL_INACTIVE,         { Message is INACTIVE                       }
  638.                         {   Doors should NOT attempt to import this }
  639.                         {   message.                                }
  640.   UPL_PRIVATE,          { Message is PRIVATE                        }
  641.   UPL_NO_ECHO,          { Message is NOT to be echoed               }
  642.                         {   This feature is not yet implemented in  }
  643.                         {   the Blue Wave reader or doors, as none  }
  644.                         {   of the currently supported BBS software }
  645.                         {   has support for this feature.           }
  646.   UPL_HAS_FILE,         { Message has file "attached" to it         }
  647.                         {   It is up to the door to check the       }
  648.                         {   validity of this flag.  If the file is  }
  649.                         {   contained in the mail packet, great.    }
  650.                         {   If not, the door should probably prompt }
  651.                         {   the user to begin uploading the file    }
  652.                         {   after importing the messages.  (Not yet }
  653.                         {   implemented in the Blue Wave reader.)   }
  654.   UPL_NETMAIL,          { Message is NetMail                        }
  655.                         {   Indicates that NetMail-specific fields  }
  656.                         {   are utilized, and should be set for     }
  657.                         {   messages entered in a FidoNet-style     }
  658.                         {   NetMail area.                           }
  659.   UPL_MRES6,            { RESERVED FOR FUTURE USE                   }
  660.   UPL_MRES7,            { RESERVED FOR FUTURE USE                   }
  661.   UPL_MRES8,            { RESERVED FOR FUTURE USE                   }
  662.   UPL_MRES9,            { RESERVED FOR FUTURE USE                   }
  663.   UPL_MRES10,           { RESERVED FOR FUTURE USE                   }
  664.   UPL_MRES11,           { RESERVED FOR FUTURE USE                   }
  665.   UPL_MRES12,           { RESERVED FOR FUTURE USE                   }
  666.   UPL_MRES13,           { RESERVED FOR FUTURE USE                   }
  667.   UPL_MRES14,           { RESERVED FOR FUTURE USE                   }
  668.   UPL_MRES15,           { RESERVED FOR FUTURE USE                   }
  669.   UPL_MRES16            { RESERVED FOR FUTURE USE                   }
  670. );
  671.  
  672. upl_net_attr =
  673. (
  674.   UPL_NRES1,            { RESERVED FOR FUTURE USE             }
  675.   UPL_NETCRASH,         { Crash = High priority mail          }
  676.   UPL_NRES2,            { RESERVED FOR FUTURE USE             }
  677.   UPL_NRES3,            { RESERVED FOR FUTURE USE             }
  678.   UPL_NETFILE,          { File Attach = Send file(s) listed   }
  679.                         {   in Subject field                  }
  680.   UPL_NRES4,            { RESERVED FOR FUTURE USE             }
  681.   UPL_NRES5,            { RESERVED FOR FUTURE USE             }
  682.   UPL_NETKILL,          { Kill/Sent = Delete after sending    }
  683.   UPL_NETLOCAL,         { Local = Message originated here     }
  684.   UPL_NETHOLD,          { Hold = Hold for pickup, do not send }
  685.   UPL_NETIMMEDIATE,     { Immediate = Send message NOW        }
  686.   UPL_NETFRQ,           { File Request = Request file(s)      }
  687.                         {   listed in Subject field           }
  688.   UPL_NETDIRECT,        { Direct = Send direct, no routing    }
  689.   UPL_NRES6,            { RESERVED FOR FUTURE USE             }
  690.   UPL_NRES7,            { RESERVED FOR FUTURE USE             }
  691.   UPL_NETURQ            { Update Request = Request updated    }
  692.                         {   file(s) listed in Subject field   }
  693. );
  694.  
  695. UPL_REC =
  696. record
  697.   mfrom:array[1..36] of byte; { Person message is from                        }
  698.                               {   NOTE: Doors should validate this field!     }
  699.   mto:array[1..36] of byte;   { Person message is to                          }
  700.   subj:array[1..72] of byte;  { Subject/Title of message                      }
  701.   destzone:word;              { Destination zone of message (NetMail only)    }
  702.                               {   If the message is not a FidoNet NetMail     }
  703.                               {   message, this field (and the subsequent     }
  704.                               {   three fields as well) should be set to      }
  705.                               {   zero.                                       }
  706.   destnet:word;               { Destination net of message (NetMail only)     }
  707.   destnode:word;              { Destination node of message (NetMail only)    }
  708.   destpoint:word;             { Destination point of message (NetMail only)   }
  709.   msg_attr:set of             { Bit-mapped message attributes                 }
  710.            upl_msg_attr;
  711.   netmail_attr:set of         { Bit-mapped NetMail message attributes         }
  712.                upl_net_attr;
  713.   unix_date:longint;          { Date/time of message                          }
  714.                               {   This Unix-style date/time value (number     }
  715.                               {   of seconds since 01/01/70) is converted to  }
  716.                               {   the date/time storage method used by the    }
  717.                               {   host BBS.                                   }
  718.   replyto:longint;            { This unsigned long word stores the message #  }
  719.                               {   that this message is a reply to.  This      }
  720.                               {   should be the same as FTI.MSGNUM.  Note,    }
  721.                               {   however, that FTI.MSGNUM is a word.  C      }
  722.                               {   programmers especially will need to         }
  723.                               {   properly typecast the value (i.e.           }
  724.                               {   upl.replyto=longint(fti.msgnum)).  As       }
  725.                               {   messaging/BBS systems become more complex,  }
  726.                               {   FTI.MSGNUM may become obsolete, and a       }
  727.                               {   longint variable may be used in its place.  }
  728.   filename:array[1..13]       { Filename the message text is in               }
  729.            of byte;           {   If this file does not exist in the upload   }
  730.                               {   packet then doors should consider this an   }
  731.                               {   invalid record.                             }
  732.   echotag:array[1..21]        { Area tag the message goes in                  }
  733.           of byte;            {   This must correspond exactly to the         }
  734.                               {   INF_AREA_INFO.ECHOTAG field for the message }
  735.                               {   area this message belongs to.  Simple area  }
  736.                               {   number matching has proven not to work      }
  737.                               {   simply because sysops are finicky people,   }
  738.                               {   and seem to constantly renumber/change the  }
  739.                               {   message area numbers on the host BBS.       }
  740.                               {   Using an echotag helps to alleviate this    }
  741.                               {   problem.  C_ECHO will be C_ECHO on the BBS, }
  742.                               {   whether it is msg area 17 on the host BBS   }
  743.                               {   or whether it is area 207. Doors should do  }
  744.                               {   a case-INSENSITIVE compare on this field to }
  745.                               {   find where the message belongs.             }
  746.   area_flags:word;            { The Blue Wave Offline Mail Reader uses this   }
  747.                               {   word internally to store the same value as  }
  748.                               {   in INF_AREA_INFO.AREA_FLAGS.  The purpose   }
  749.                               {   of this word is to hold the original        }
  750.                               {   information about the message area so that  }
  751.                               {   later message editing processes can be      }
  752.                               {   controlled properly.  For example, if a     }
  753.                               {   user later wanted to edit this message, the }
  754.                               {   reader would know instantly whether this is }
  755.                               {   a NETMAIL area, whether PVT messages are    }
  756.                               {   allowed, etc.  This allows re-editing of    }
  757.                               {   the message, even when there is not a       }
  758.                               {   corresponding *.INF file laying around, or  }
  759.                               {   the area is not listed in the *.INF file    }
  760.                               {   you currently have to work with.  DOOR      }
  761.                               {   AUTHORS SHOULD IGNORE THIS FIELD WHEN       }
  762.                               {   IMPORTING MESSAGES!                         }
  763.   f_attach:array[1..13]       { If the UPL_HAS_FILE flag is set, this field   }
  764.            of byte;           {   will contain the file name that is attached }
  765.                               {   to the message.                             }
  766.   user_area:array[1..7]       { User-defined storage.  Doors should ignore    }
  767.             of byte;          {   this field, and reader authors should feel  }
  768.                               {   free to utilize this field for their own    }
  769.                               {   internal use, if necessary.                 }
  770.   net_dest:array[1..100]      { Network destination address                   }
  771.            of byte;           {   If the message is for a non-FidoNet network }
  772.                               {   message area, this field will contain the   }
  773.                               {   ASCII representation of the destination     }
  774.                               {   address.                                    }
  775. end;
  776.  
  777. (*---------------------------------------------------------------------------*)
  778.  
  779. (*
  780. **  Name of file:   *.REQ
  781. **
  782. **  Description:    The *.REQ file is simply a list of filenames the user
  783. **                  wants to request from the host BBS.  Wildcard characters
  784. **                  ("*" and "?" under MS-DOS) are allowed, but are not
  785. **                  guaranteed to produce accurate results on all door
  786. **                  implementations.
  787. **
  788. **                  NOTE:   Current Blue Wave doors do not accept wildcard
  789. **                          characters in filenames, and will consider any
  790. **                          filenames which contain them as being invalid.
  791. **                          Additionally, if there are more than 10 entries in
  792. **                          the *.REQ file, current Blue Wave doors will read
  793. **                          the first 10 and discard the rest.  These are
  794. **                          limitations of the Blue Wave doors, not of the
  795. **                          Blue Wave format itself.
  796. **
  797. **  File format:    REQ_REC     { repeated for as many files as }
  798. **                  REQ_REC     { requested from the host BBS   }
  799. **                  ...
  800. *)
  801.  
  802. REQ_REC =
  803. record
  804.   filename:array[1..13] of byte;    { Name of file to request }
  805. end;
  806.  
  807. (*---------------------------------------------------------------------------*)
  808.  
  809. (*
  810. **  Name of file:   *.PDQ
  811. **
  812. **  Description:    The *.PDQ file contains the information used for the
  813. **                  offline configuration feature of the mail door.  After the
  814. **                  header is a series of records which indicate the message
  815. **                  areas to enable for scanning the next time a mail packet
  816. **                  is requested.
  817. **
  818. **                  NOTE:   If the AREA_CHANGES flag in PDQ_HEADER.FLAGS is
  819. **                          set, the door should process the offline
  820. **                          configuration as well as changes to the list of
  821. **                          areas the user wants to download.  In the Blue
  822. **                          Wave door, this is done by first turning OFF all
  823. **                          message areas that were active, then turning ON
  824. **                          the ones specified in the *.PDQ file.  This seems
  825. **                          to be the simplest, most straight-forward method
  826. **                          of accomplishing this task, though other, more
  827. **                          complex schemes could easily have been devised.
  828. **
  829. **  File format:    PDQ_HEADER      { only included one time!
  830. **                  PDQ_REC         { repeated for as many message areas }
  831. **                  PDQ_REC         { as the user wishes to enable       }
  832. **                  ...
  833. *)
  834.  
  835. pdq_flags =
  836. (
  837.   PDQ_HOTKEYS,          { Toggle "hotkeys" in prompts        }
  838.   PDQ_XPERT,            { Toggle expert mode (menu displays) }
  839.   PDQ_AREA_CHANGES,     { Change active message areas        }
  840.   PDQ_GRAPHICS,         { Toggle IBM 8-bit ASCII characters  }
  841.   PDQ_NOT_MY_MAIL,      { Toggle bundling mail from user     }
  842.   PDQ_RESERVED1,        { RESERVED FOR FUTURE USE            }
  843.   PDQ_RESERVED2,        { RESERVED FOR FUTURE USE            }
  844.   PDQ_RESERVED3,        { RESERVED FOR FUTURE USE            }
  845.   PDQ_RESERVED4,        { RESERVED FOR FUTURE USE            }
  846.   PDQ_RESERVED5,        { RESERVED FOR FUTURE USE            }
  847.   PDQ_RESERVED6,        { RESERVED FOR FUTURE USE            }
  848.   PDQ_RESERVED7,        { RESERVED FOR FUTURE USE            }
  849.   PDQ_RESERVED8,        { RESERVED FOR FUTURE USE            }
  850.   PDQ_RESERVED9,        { RESERVED FOR FUTURE USE            }
  851.   PDQ_RESERVED10,       { RESERVED FOR FUTURE USE            }
  852.   PDQ_RESERVED11        { RESERVED FOR FUTURE USE            }
  853. );
  854.  
  855. PDQ_HEADER =
  856. record
  857.   keywords:array[1..10] of          { User's entire set of door keywords  }
  858.            array[1..21] of byte;
  859.   filters:array[1..10] of           { User's entire set of door filters   }
  860.           array[1..21] of byte;
  861.   macros:array[1..3] of             { User's door bundling command macros }
  862.          array[1..78] of byte;
  863.   password:array[1..21] of byte;    { Password                            }
  864.   passtype:byte;                    { Password type                       }
  865.                                     {   0=none 1=door 2=reader 3=both     }
  866.   flags:set of pdq_flags;           { Bit-mapped flags                    }
  867. end;
  868.  
  869. PDQ_REC =
  870. record
  871.   echotag:array[1..21] of byte;   { Echo tag of message area to activate    }
  872.                                   {   With Telegard systems, this should    }
  873.                                   {   be the name of the *.BRD file, rather }
  874.                                   {   than the actual echo tag.             }
  875. end;
  876.  
  877.